<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

        *{
            padding: 0;/*内边距*/
            margin: 0;
        }

        html,body{ /*让容器的高度和宽度都充满全屏*/
            width: 100%;
            height: 100%;
        }

        body{
            background-color: pink;
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: center;
        }

        .heart{
            width: 200px;
            height: 200px;
            background-color: red; 
            position: relative;  
            transform: rotate(45deg);
            animation: heartbit 0.5s alternate infinite;
            box-shadow: 0 0 30px red;
        }

        .heart::before{
            content:"";
            width: 200px;
            height: 100px;
            background-color: aqua;
            position:absolute;
            left: 0;
            top: -99px;
            border-radius: 100px 100px 0 0;
            background-color: red;
            box-shadow: 0 0 30px red;
        }

        .heart::after{
            content:"";
            width: 100px;
            height: 200px;
            background-color: aqua;
            position:absolute;
            left:-99px;
            top:0; 
            border-radius: 100px 0 0 100px;
            background-color: red;
            box-shadow: 0 0 30px red;
        }

        img{
            width: 145px;
            height:145px;
            transform: rotate(-45deg);
            position: absolute;
            top:10px;
            left:18px;
            right:30px;
            border-radius: 30px;
        }

                /* 添加一些装饰性的小爱心 */
        .mini-hearts {
            position: absolute;
            width: 100%;
            height: 100%;
        }

        .mini-heart {
            position: absolute;
            width: 20px;
            height: 20px;
            opacity: 0;
        }

        .mini-heart::before,
        .mini-heart::after {
            content: '';
            position: absolute;
            width: 30px;
            height: 40px;
            border-radius: 8px 8px 0 0;
            background: rgb(255, 107, 107);
            transform-origin: 50% 100%;
        }

        .mini-heart::before {
            left: 10px;
            transform: rotate(-45deg);
        }

        .mini-heart::after {
            left: 0;
            transform: rotate(45deg);
        }

        .mini-heart:nth-child(1) {
            left: -60px;
            top: 0;
            animation: float 3s ease-in-out infinite;
        }

        .mini-heart:nth-child(2) {
            right: -60px;
            top: 30px;
            animation: float 3s ease-in-out infinite 0.5s;
        }

        .mini-heart:nth-child(3) {
            left: -40px;
            bottom: 0;
            animation: float 3s ease-in-out infinite 1s;
        }

        @keyframes float {
            0% {
                transform: translateY(0) scale(0.5);
                opacity: 0;
            }
            50% {
                opacity: 0.6;
            }
            100% {
                transform: translateY(-100px) scale(1);
                opacity: 0;
            }
        }

        @keyframes  heartbit{
            0%{
                transform: rotate(45deg) scale(0.6);
            }
            /*25%{
                transform: rotate(45frg) scale(0.8);
            }
            50%{
                 transform: rotate(45frg) scale(1);
            }
            75%{
                 transform: rotate(45frg) scale(0.8);
            }*/
            100%{
                 transform: rotate(45frg) scale(0.6);
            }
        }

    </style>
</head>
<body>
    <div class="heart">
        <div class="mini-hearts">
            <div class="mini-heart"></div>
            <div class="mini-heart"></div>
            <div class="mini-heart"></div>
        <img src="./8.jpg" alt="">
    </div>
</body>
</html>